<template>
  <div class="bg-[#232324] h-[100%]">
    <el-collapse v-loading="loading" v-model="activeNames">
      <el-form label-width="100" :model="states" size="default">
        <el-collapse-item title="轮播属性" name="1" class="myCol">
          <el-form-item label="自动切换">
            <el-switch v-model="states.autoplay" />
          </el-form-item>
          <el-form-item label="循环显示">
            <el-switch v-model="states.loop" />
          </el-form-item>
          <el-form-item label="自动切换时间">
            <el-input-number v-model="states.interval" />
          </el-form-item>
          <el-form-item label="指示器触发">
            <el-select v-model="states.trigger" placeholder="请选择">
              <el-option label="hover" value="hover" />
              <el-option label="click" value="click" />
            </el-select>
          </el-form-item>
          <el-form-item label="方向">
            <el-select v-model="states.direction" placeholder="请选择">
              <el-option label="横向" value="horizontal" />
              <el-option label="纵向" value="vertical" />
            </el-select>
          </el-form-item>
          <!-- <el-form-item label="指示器的位置">
            <el-select v-model="states.indicatorPosition" placeholder="请选择">
              <el-option label="无" value="none" />
              <el-option label="默认" value="''" />
              <el-option label="外部" value="outside" />
            </el-select>
          </el-form-item> -->

          <!-- <el-form-item label="轮播类型">
            <el-select v-model="states.type" placeholder="请选择">
              <el-option label="默认" value="''" />
              <el-option label="卡片" value="card" />
            </el-select>
          </el-form-item> -->
        </el-collapse-item>
        <el-collapse-item :title="`添加图片`" name="asdfa">
          <CauouselEdit v-model:list="states.data" />
        </el-collapse-item>
      </el-form>
    </el-collapse>
  </div>
</template>

<script setup>
import { computed, onMounted, ref } from "vue";
import CauouselEdit from "@renderer/components/Carousel/index.vue";
const loading = ref(true);
const activeNames = ref();
const props = defineProps({
  models: {
    type: Object,
    default: () => ({}),
  },
});
const emit = defineEmits(["update:models"]);

onMounted(() => {
  setTimeout(() => {
    loading.value = false;
  }, 200);
});

const states = computed({
  get: () => props.models,
  set: () => emit("update:models"),
});
</script>

<style scoped lang="scss">
:deep(.el-collapse-item__header) {
  padding-left: 10px !important;
}
:deep(.el-select) {
  width: 180px !important;
}

:deep(.el-table tr) {
  background-color: #232324 !important;
}
:deep(.el-table th.el-table__cell) {
  background-color: #232324 !important;
}

:deep(.myCol .el-input) {
  width: 180px !important;
}
:deep(.myCol .el-select) {
  width: 180px !important;
}
</style>
